#include "cpu/exec/template-start.h"

#define instr js

static void do_execute() {
    int instr_len;
    int32_t offset;

    if (DATA_BYTE == 1) {
        instr_len = 2; 
        offset = (int8_t)op_src->val;
    } else {
        instr_len = 6;  
        offset = (int32_t)op_src->val;
    }

    uint32_t target = cpu.eip + instr_len + offset;

    if (cpu.eflags.SF == 1) {
        cpu.eip = target - instr_len;
    }

    print_asm(str(instr) " %x", target);
}

make_instr_helper(i)

#include "cpu/exec/template-end.h"
